<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册</title>
<script type="text/javascript">
    function check() {
    	var email = document.getElementById("email");
        var username = document.getElementById("username");
        var upwd = document.getElementById("password");
        var upwd2 = document.getElementById("password2");
        if(email.value.indexOf("@") == -1){
        	alert("电子邮件中应包含@字符!");
            return false;
        }else if(username.value == ""){
            alert("账号不能为空!");
            return false;
        }else if(upwd.value.length < 4){
            alert("口令长度不能少于4个字符!");
            return false;
        }else if(upwd.value != upwd2.value ){
            alert("口令输入有误,请检查!");
            return false;
        }
    }
</script>
</head>
<body>
<center>
    <form action="/WebStoreSSM/controller/registerAction" method="post" onsubmit="return check();">
        <fieldset>
            <legend style="color:#00f" > <h3>Register</h3></legend>
            <table>
                <tr><th colspan="2" style="color: #f00">${requestScope.messageRe}</th></tr>
                <tr><th>邮&nbsp;&nbsp;箱：</th><th><label><input type="text" name="email" id="email"></label></th></tr>
                <tr><th>账&nbsp;&nbsp;号：</th><th><label><input type="text" name="username" id="username"></label></th></tr>
                <tr><th>口&nbsp;&nbsp;令：</th><th><label><input type="password" name="password" id="password"></label></th></tr>
                <tr><th>口令确认：</th><th><label><input type="password" name="password2" id="password2"></label></th></tr>
                <tr><th colspan="2"><input type="submit" value="注册">
                                                        <a href="/WebStoreSSM/login.jsp"><input type="button" value="登录" ></a></th></tr>
            </table>
        </fieldset>
    </form>
</center>
</body>
</html>